package com.jinke.api.modules.app.controller;


import com.jinke.api.common.api.CommonResult;
import com.jinke.api.modules.app.controller.res.PriceSurchargeImportDto;
import com.jinke.api.modules.app.controller.res.ZipCodeImportDto;
import com.jinke.api.modules.app.service.PriceSurchargeService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * <p>
 * 自定义价格-附加费表 前端控制器
 * </p>
 *
 * @author husuruo
 * @since 2024-07-30
 */
@RestController
@RequestMapping("/app/priceSurcharge")
@RequiredArgsConstructor
public class PriceSurchargeController {

    private final PriceSurchargeService priceSurchargeService;
    @ApiOperation("导入附加费")
    @PostMapping("/importPriceSurcharge")
    public CommonResult<String> importPriceSurcharge(PriceSurchargeImportDto importDto) throws IOException {
        return priceSurchargeService.importPriceSurcharge(importDto);
    }

    @ApiOperation("导入zipCode到redis")
    @PostMapping("/importZipCode")
    public CommonResult<String> importZipCode(ZipCodeImportDto importDto) throws IOException {
        return priceSurchargeService.importZipCode(importDto);
    }
}

